<template>
	<view class="container">
		<view class="container-box">
			<view class="big-box" @tap="goDepositExpress">
				<view class="deposit-box">
					<view class="deposit-icon">
						<image src="../../../static/images/pickup2.png" class="deposit-img"></image>
					</view>
					<view class="text">我想存快递</view>
				</view>
			</view>
			<view class="cell"></view>
			<view class="big-box" style="margin-bottom: 50rpx;" @tap="goPickup">
				<view class="deposit-box">
					<view class="deposit-icon">
						<image src="../../../static/images/pickup2.png" class="deposit-img"></image>
					</view>
					<view class="text">我想取快递</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var common = require('../../../utils/common.js');
	var app = getApp();
	var _this;
	const getvisitorList = () => {
		common.post('HouseApi&a=express_num_add_info', {
			equipment_id: "867394040230038",
		}, data => {
			console.log('++++', data)
			uni.navigateTo({
				url:'/pages/village/smartExpressCabinet/courierManagement'
			})
		},_this,fail => {
			uni.showModal({
				title: common.changeTxt('提示'),
				content: fail.data.errorMsg,
				showCancel: false,
				confirmText: common.changeTxt('确定'),
				success: function(res) {
					if (res.confirm) {
						uni.navigateTo({
							url:'/pages/village/smartExpressCabinet/courierCertification'
						})
					}
				}
			});
			
		});
	};
	
	export default {
		data() {
			return {
				listdata: {},
				numlist:{},
				village_id: 0,
				pigcms_id: 0,
				actcolor: '',
				btn_style: '',
				mobile_head_color: '',
				id:0,
				equipment_id:'',
			}
		},
		onShow() {
			// #ifdef H5
			common.hideWxShare()
			// #endif
		},
		onLoad(options) {
			_this = this;
			// #ifdef H5
			console.log('准备跳小程序页', _this.id);
			common.webToMiniapp(_this.route, options, 'redirect')
			// #endif
			//获取扫码传过来的设备id;
			_this.equipment_id = options.equipment_id;
			common.setMainColor(_this, function(config) {
				_this.mobile_head_color = config.config.mobile_head_color
				_this.actcolor = config.config.mobile_head_color
				_this.btn_style = 'background-color: ' + _this.actcolor + ';box-shadow:0px 30rpx 30rpx -30rpx ' + _this.actcolor +
					';';
				if (!app.globalData.is_login) {
					if (config.config.is_demo_domain) {
						uni.showModal({
							title: common.changeTxt('提示'),
							content: common.changeTxt('您还未登录,请立即登录使用快递柜'),
							showCancel: false,
							confirmText: common.changeTxt('去登录'),
							success: function(res) {
								if (res.confirm) {
									_this.user_options = {
										toLogin: true
									};
								}
							}
						});
					}
				}
				const res = uni.getStorageSync('village_key');
				if (res) {
					_this.village_id = res.village_id;
					_this.pigcms_id = res.pigcms_id;
					_this.village_name = res.village_name;
				};
				// getvisitorList()
			});
		},
		methods: {
			goDepositExpress(){
				getvisitorList();
			},
			goPickup(){
				uni.navigateTo({
					url:'/pages/village/smartExpressCabinet/courierManagement?equipment_id=' + _this.equipment_id
				})
			},
		},
		components: {
			
		}
	}
</script>

<style>
	page {
		background: rgb(245, 245, 245);
	}

	.container {
		margin: 0;
		padding: 0;
		margin-top: 15rpx;
	}
	.container-box {
		background: #FFFFFF;
		padding: 50rpx 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.big-box {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 150rpx;
	}
	.deposit-box {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.deposit-icon {
		width: 300rpx;
		height: 300rpx;
		border-radius: 300rpx;
	}
	.deposit-img {
		width: 100%;
		height: 100%;
		display: block;
		border-radius: 300rpx;
	}
	.text {
		margin-top: 50rpx;
	}
	.cell {
		width: 500rpx;
		height: 2rpx;
		background: #CCCCCC;
		margin-top: 110rpx;
	}
</style>
